<template>
  <div class="homeview">
    <ForAphorism :context="aphorism" />
    <div style="margin: 20px;padding-top:20px;">
    <ItemImage
      v-for="(item, index) in itemImages"
      :key="index"
      :info="item"
    />
    </div>
  </div>
</template>
<script lang="ts">
import ForAphorism from "@/components/ForAphorism.vue"; // @ is an alias to /src
import ItemImage from "@/components/ItemImage.vue";

import { defineComponent,ref, reactive ,watchEffect,watch,getCurrentInstance} from "vue";

export default defineComponent({
  components: {
    ForAphorism,
    ItemImage,
  },
setup: (props, context) => {
    console.log("homeview")

    const internalInstance = getCurrentInstance()
    if (!!internalInstance){
       console.log("全局变量" + internalInstance.appContext.config.globalProperties.$http);
    }

    

        var defaultData = {
      aphorism: [
        {
          message: "朝闻道，夕死可矣",
          imageUrl: "home/kongzi.png",
          name: "孔子",
        },
        {
          message: "书山有路勤为径，学海无涯苦作舟",
          imageUrl: "home/hanyu.png",
          name: "韩愈",
        },
        {
          message: "为天地立心，为生民立命，为往圣继绝学，为万世开太平",
          imageUrl: "home/zhangzai.png",
          name: "张载",
        },
        {
          message: "为中华之崛起而读书",
          imageUrl: "home/zhouenlai.png",
          name: "周恩来",
        },
        {
          message: "为中华民族伟大复兴而努力奋斗",
          imageUrl: "home/xijinping.png",
          name: "习近平",
        },
      ],
      itemImages: [
        {
          message: "幼儿园：愿你健康，愿你快乐",
          imageUrl: "home/youeryuan.png",
          name: "孔子",
        },
        {
          message: "小学生：愿你可爱，愿你活泼",
          imageUrl: "home/xiaoxuesheng.png",
          name: "韩愈",
        },
        {
          message: "中学生：愿你更高，愿你更强",
          imageUrl: "home/zhongxuesheng.png",
          name: "张载",
        },
        {
          message: "大学生：愿你充满理想，愿你前程似锦",
          imageUrl: "home/daxuesheng.png",
          name: "周恩来",
        },
      ],
  
    };
    console.log(defaultData);
    return defaultData;
}
})
</script>

<style lang="less" scope>

</style>